<!DOCTYPE html>
<!--suppress ALL-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>秒杀活动</h1>
<table border="1">
    <tr>
        <td>商品id</td>
        <td>秒杀价</td>
        <td>库存数量</td>
        <td>秒杀开始</td>
        <td>秒杀结束</td>
        <td>操作</td>
    </tr>
    <tr th:each="item :${list}">
        <td th:text="${item.goodsId}"></td>
        <td th:text="${item.getMiaoshaPrice()}"></td>
        <td th:text="${item.getStockCount()}"></td>
        <td th:text="${#dates.format(item.startDate,'yyyy-MM-dd HH:mm:ss')}"></td>
        <td th:text="${#dates.format(item.endDate,'yyyy-MM-dd HH:mm:ss')}"></td>
        <td> <button th:onclick="goto([[${item.goodsId}]])">详情</button></td>
    </tr>
</table>
<script>
    function goto(id){
        console.log(id)
        location="http://localhost:7000/"+id+".html"
    }
</script>
</body>
</html>